const chalk = require('chalk');
const { curry } = require('ramda');

const coloredChalk = (percentage, logStr) => {
    let colored;

    switch (true) {
    case percentage <= 25:
        colored = chalk.red;
        break;
    case percentage > 25 && percentage <= 50:
        colored = chalk.yellow;
        break;
    case percentage > 50 && percentage <= 75:
        colored = chalk.green;
        break;
    case percentage > 75 && percentage <= 100:
        colored = chalk.blue;
        break;
    default:
        colored = chalk.green;
    }

    return colored(logStr);
};

module.exports = curry(coloredChalk);
